package com.night.jdbc.tx;

import jakarta.annotation.Nullable;

import java.sql.Connection;

/**
 * @Author: chen yang
 * @Date: 2024/12/7 10:27
 */
public class TransactionalUtils {

    @Nullable
    public static Connection getCurrentConnection() {
        TransactionStatus ts = DataSourceTransactionManager.transactionStatus.get();
        return ts == null ? null : ts.connection;
    }
}
